From ecb171d4a92fdcef04ef1dfd6d2d0b839068ee88 Mon Sep 17 00:00:00 2001 From: Hollis Blanchard Date: Tue, 12 Sep 2006 14:28:16 -0500 Subject: [PATCH] [XEN][POWERPC] Split dom0_ops.c into domctl.c and sysctl.c. Signed-off-by: Hollis Blanchard --- xen/arch/powerpc/Makefile | 3 +- xen/arch/powerpc/{dom0_ops.c => domctl.c} | 36 ------------- xen/arch/powerpc/sysctl.c | 65 +++++++++++++++++++++++ 3 files changed, 67 insertions(+), 37 deletions(-) rename xen/arch/powerpc/{dom0_ops.c => domctl.c} (78%) create mode 100644 xen/arch/powerpc/sysctl.c diff --git a/xen/arch/powerpc/Makefile b/xen/arch/powerpc/Makefile index 80e60a327e..ce855e2e42 100644 --- a/xen/arch/powerpc/Makefile +++ b/xen/arch/powerpc/Makefile @@ -13,7 +13,7 @@ obj-y += dart.o obj-y += dart_u3.o obj-y += dart_u4.o obj-y += delay.o -obj-y += dom0_ops.o +obj-y += domctl.o obj-y += domain_build.o obj-y += domain.o obj-y += exceptions.o @@ -37,6 +37,7 @@ obj-y += setup.o obj-y += shadow.o obj-y += smp.o obj-y += smp-tbsync.o +obj-y += sysctl.o obj-y += time.o obj-y += usercopy.o diff --git a/xen/arch/powerpc/dom0_ops.c b/xen/arch/powerpc/domctl.c similarity index 78% rename from xen/arch/powerpc/dom0_ops.c rename to xen/arch/powerpc/domctl.c index 35d0e95581..ecdae23271 100644 --- a/xen/arch/powerpc/dom0_ops.c +++ b/xen/arch/powerpc/domctl.c @@ -116,39 +116,3 @@ long arch_do_domctl(struct xen_domctl *domctl, return ret; } - -long arch_do_sysctl(struct xen_sysctl *sysctl, - XEN_GUEST_HANDLE(xen_sysctl_t) u_sysctl); -long arch_do_sysctl(struct xen_sysctl *sysctl, - XEN_GUEST_HANDLE(xen_sysctl_t) u_sysctl) -{ - long ret = 0; - - switch (sysctl->cmd) { - case XEN_SYSCTL_physinfo: - { - xen_sysctl_physinfo_t *pi = &sysctl->u.physinfo; - - pi->threads_per_core = 1; - pi->cores_per_socket = 1; - pi->sockets_per_node = 1; - pi->nr_nodes = 1; - pi->total_pages = total_pages; - pi->free_pages = avail_domheap_pages(); - pi->cpu_khz = cpu_khz; - memset(pi->hw_cap, 0, sizeof(pi->hw_cap)); - ret = 0; - if ( copy_to_guest(u_sysctl, sysctl, 1) ) - ret = -EFAULT; - } - break; - - default: - printk("%s: unsupported sysctl: 0x%x\n", __func__, (sysctl->cmd)); - ret = -ENOSYS; - break; - } - - return ret; -} - diff --git a/xen/arch/powerpc/sysctl.c b/xen/arch/powerpc/sysctl.c new file mode 100644 index 0000000000..5d25d696fd --- /dev/null +++ b/xen/arch/powerpc/sysctl.c @@ -0,0 +1,65 @@ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * Copyright (C) IBM Corp. 2005 + * + * Authors: Jimi Xenidis + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +long arch_do_sysctl(struct xen_sysctl *sysctl, + XEN_GUEST_HANDLE(xen_sysctl_t) u_sysctl); +long arch_do_sysctl(struct xen_sysctl *sysctl, + XEN_GUEST_HANDLE(xen_sysctl_t) u_sysctl) +{ + long ret = 0; + + switch (sysctl->cmd) { + case XEN_SYSCTL_physinfo: + { + xen_sysctl_physinfo_t *pi = &sysctl->u.physinfo; + + pi->threads_per_core = 1; + pi->cores_per_socket = 1; + pi->sockets_per_node = 1; + pi->nr_nodes = 1; + pi->total_pages = total_pages; + pi->free_pages = avail_domheap_pages(); + pi->cpu_khz = cpu_khz; + memset(pi->hw_cap, 0, sizeof(pi->hw_cap)); + ret = 0; + if ( copy_to_guest(u_sysctl, sysctl, 1) ) + ret = -EFAULT; + } + break; + + default: + printk("%s: unsupported sysctl: 0x%x\n", __func__, (sysctl->cmd)); + ret = -ENOSYS; + break; + } + + return ret; +} -- 2.30.2